using System;
using System.Linq.Expressions;
using System.Windows.Controls;

namespace FluentSilverlight.Binders
{
    public abstract class ContentControlBinder<THIS, TControl, TModel> : ControlBinder<THIS, TControl, TModel>
        where TModel : class
        where TControl : ContentControl
    {
        protected ContentControlBinder(TModel model, TControl control)
            : base(model, control)
        {
        }

        public THIS Content(Expression<Func<TModel, object>> expression)
        {
            propertyBinder.SetBinding(expression, ContentControl.ContentProperty);
            return thisInstance();
        }
    }
}